;(function() {
	'use strict';
	angular.module('services.sysServiceData.pBossSuccessRate')
		.factory('pBossSuccessRate', pBossSuccessRate);
	function pBossSuccessRate(Restangular){
		return {
			querySuccessRate : function(params,callback){
				Restangular.all('sas/sysServiceData/pboss/pbossProvsSuccessRate').post(params).then(callback);
			},
			queryDet : function(params,callback){
				Restangular.all('sas/sysServiceData/pboss/pbossProvsSuccessRateDetail').post(params).then(callback);
			},
			queryTableDet : function(params,callback){
				Restangular.all('sas/sysServiceData/pboss/pbossProvsSuccessRateTableDetail').post(params).then(callback);
			},
			getProvinceObj:function(){
				return [{
					provinceObjCode:'1',provinceObjName:'省公司'
				},{
					provinceObjCode:'2',provinceObjName:'政企公司'
				}];
			},
			getPageBind : function(){
				var year = new Date().getFullYear();
				return {
					provinceObj : '1',
					province : [],
					startTime : Number(year),
					endTime : Number(year),
					timeType : '5'
				};
			},
			getTimeType : function(){
				return [{
					timeTypeCode:'3',timeTypeName:'月'
				},{
					timeTypeCode:'5',timeTypeName:'年'
				}];
			},
			changeTimeType : function(timeType,sendData){
				var year = new Date().getFullYear();
				var month = new Date().getMonth();
				if(timeType === '3'){
					sendData.startTime = new Date(year,month);
					sendData.endTime = new Date(year,month);
				}else {
					sendData.startTime = Number(year);
					sendData.endTime = Number(year);
				}
			}
		};
	}
})();